package xushuo.dao.dao.base;

import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate4.support.HibernateDaoSupport;

import javax.annotation.Resource;

/**
 * Create by zhangpe0312@qq.com on 2018/2/7.
 *
 * 回去看一下
 *
 */
public class HibernateDao {
//extends HibernateDaoSupport
//    @Autowired
//    public void setSuperSessionFactory(SessionFactory sessionFactory){
//        super.setSessionFactory(sessionFactory);
//    }
//
//    /**
//     * 获取session
//     * @return session
//     */
//    public Session getCurrentSession(){
//        Session session = null;
//        try {
//            session = getSessionFactory().getCurrentSession();
//        } catch (HibernateException e) {
//            throw new RuntimeException("getCurrentSession error", e);
//            //session = getSessionFactory().openSession();
//        }
//        return session;
//    }
}
